<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <form id="my-form" class="am-form tpl-form-line-form" method="post">
                    <div class="widget-body">
						<div class="tips am-margin-bottom-sm am-u-sm-12">
							<div class="pre">
								<p>提醒：营业执照、银行账户、特殊资质、身份证信息必须为同一人或同一主体。（证照：必须平放拍摄或扫描件，必须清晰）</p>
								<p> 
									<input type="hidden" name="wxpay[status]" value="<?= $model['status']['value'] ?>">
									<?= $model['status']['value']==0?'提示：您还没有提交申请':''?>
									<?= $model['status']['value']==10?'提示：资料审核中，有问题会给您电话联系':''?>
									<?= $model['status']['value']==20?'提示：资料验证中，申请已提交请耐心等待1-3天':''?>
									<?= $model['status']['value']==30?'提示：申请已通过,您已注册成功':''?>
									<?= $model['status']['value']==40?'提示：申请被驳回，请按要求修改后提交':''?>
								</p>
								<?PHP if($model['status']['value']==40):?>
								<p><?= $model['reject']?></p>
								<?PHP endif; ?>
							</div>
						</div>
                        <fieldset>
							<div class="widget-head am-cf">
                                <div class="widget-title am-fl">微信支付商户号快速申请</div>
                            </div>
							<?php if($model['status']['value']==30 AND !empty($model['mchid'])):?>
							<div class="am-form-group">
                                <label class="am-u-sm-3 am-form-label form-require">
									微信支付商户号 <span class="tpl-form-line-small-title">MCHID</span>
								</label>
                                <div class="am-u-sm-9">
                                    <input type="text" class="tpl-form-input" value="<?= $model['mchid'] ?>" disabled>
                                </div>
                            </div>
							<?php endif;?>
							<div class="am-form-group">
                                <label class="am-u-sm-3 am-form-label form-require">营业执照 </label>
                                <div class="am-u-sm-9 am-u-end">
									<div class="am-form-file">
										<button type="button"
											class="upload-file-license_copy am-btn am-btn-secondary am-radius" 
											<?= ($model['status']['value']==0 OR $model['status']['value']==40)?'':'disabled'?> >
											<i class="am-icon-cloud-upload"></i> 选择图片
										</button>
										<div class="uploader-list am-cf">
											<div class="file-item">
                                                <img src="<?= $model['businesslicense']['file_path'] ?>">
                                                <input type="hidden" name="wxpay[license_copy]"
                                                           value="<?= $model['businesslicense']['file_id'] ?>">
												<?PHP if($model['status']['value']==0 OR $model['status']['value']==40):?>
                                                <i class="iconfont iconshanchu file-item-delete"></i>
												<?PHP endif; ?>
                                            </div>
										</div>
									</div>
									<div class="help-block am-margin-top-sm">
										<small>大小2M以下</small>
									</div>
                                </div>
                            </div>
							<div class="am-form-group">
                                <label class="am-u-sm-3 am-form-label form-require">身份证正面 </label>
                                <div class="am-u-sm-9 am-u-end">
									<div class="am-form-file">
										<button type="button"
											class="upload-file-id_card_copy am-btn am-btn-secondary am-radius" 
											<?= ($model['status']['value']==0 OR $model['status']['value']==40)?'':'disabled'?>>
											<i class="am-icon-cloud-upload"></i> 选择图片
										</button>
										<div class="uploader-list am-cf">
											<div class="file-item">
                                                <img src="<?= $model['front']['file_path'] ?>">
                                                <input type="hidden" name="wxpay[id_card_copy]"
                                                           value="<?= $model['front']['file_id'] ?>">
                                                <?PHP if($model['status']['value']==0 OR $model['status']['value']==40):?>
                                                <i class="iconfont iconshanchu file-item-delete"></i>
												<?PHP endif; ?>
                                            </div>
										</div>
									</div>
									<div class="help-block am-margin-top-sm">
										<small>大小2M以下</small>
									</div>
                                </div>
                            </div>
							<div class="am-form-group">
                                <label class="am-u-sm-3 am-form-label form-require">身份证反面 </label>
                                <div class="am-u-sm-9 am-u-end">
									<div class="am-form-file">
										<button type="button"
											class="upload-file-id_card_national am-btn am-btn-secondary am-radius" 
											<?= ($model['status']['value']==0 OR $model['status']['value']==40)?'':'disabled'?>>
											<i class="am-icon-cloud-upload"></i> 选择图片
										</button>
										<div class="uploader-list am-cf">
											<div class="file-item">
                                                <img src="<?= $model['behind']['file_path'] ?>">
                                                <input type="hidden" name="wxpay[id_card_national]"
                                                           value="<?= $model['behind']['file_id'] ?>">
                                                <?PHP if($model['status']['value']==0 OR $model['status']['value']==40):?>
                                                <i class="iconfont iconshanchu file-item-delete"></i>
												<?PHP endif; ?>
                                            </div>
										</div>
									</div>
									<div class="help-block am-margin-top-sm">
										<small>大小2M以下</small>
									</div>
                                </div>
                            </div>
							<div class="am-form-group">
                                <label class="am-u-sm-3 am-form-label form-require">特殊资质 </label>
                                <div class="am-u-sm-9 am-u-end">
									<div class="am-form-file">
										<button type="button"
											class="upload-file-qualifications am-btn am-btn-secondary am-radius" 
											<?= ($model['status']['value']==0 OR $model['status']['value']==40)?'':'disabled'?>>
											<i class="am-icon-cloud-upload"></i> 选择图片
										</button>
										<div class="uploader-list am-cf">
											<div class="file-item">
                                                <img src="<?= $model['special']['file_path'] ?>">
                                                <input type="hidden" name="wxpay[qualifications]"
                                                           value="<?= $model['special']['file_id'] ?>">
                                                <?PHP if($model['status']['value']==0 OR $model['status']['value']==40):?>
                                                <i class="iconfont iconshanchu file-item-delete"></i>
												<?PHP endif; ?>
                                            </div>
										</div>
									</div>
									<div class="help-block am-margin-top-sm">
										<small>大小2M以下，如食品行业需提交《食品经营许可证》</small>
									</div>
                                </div>
                            </div>
							<div class="am-form-group">
                                <label class="am-u-sm-3 am-form-label form-require"> 手机号码 </label>
                                <div class="am-u-sm-9">
                                    <input type="text" class="tpl-form-input" name="wxpay[mobile_phone]"
                                           value="<?= $model['mobile_phone'] ?>"
										   <?= ($model['status']['value']==0 OR $model['status']['value']==40)?'':'disabled'?> required>
                                </div>
                            </div>
							<div class="am-form-group">
                                <label class="am-u-sm-3 am-form-label form-require"> 联系邮箱 </label>
                                <div class="am-u-sm-9">
                                    <input type="text" class="tpl-form-input" name="wxpay[contact_email]"
                                           value="<?= $model['contact_email'] ?>"
										   <?= ($model['status']['value']==0 OR $model['status']['value']==40)?'':'disabled'?> required>
                                </div>
                            </div>
							<div class="am-form-group">
                                <label class="am-u-sm-3 am-form-label form-require"> 开户银行 </label>
                                <div class="am-u-sm-9">
                                    <input type="text" class="tpl-form-input" name="wxpay[bank_name]"
                                           value="<?= $model['bank_name'] ?>"
										   <?= ($model['status']['value']==0 OR $model['status']['value']==40)?'':'disabled'?> required>
										   <small>例如：xx银行xx市xx区xx县xx支行</small>
                                </div>
                            </div>
							<div class="am-form-group">
                                <label class="am-u-sm-3 am-form-label form-require"> 银行账号 </label>
                                <div class="am-u-sm-9">
                                    <input type="text" class="tpl-form-input" name="wxpay[account_number]"
                                           value="<?= $model['account_number'] ?>"
										   <?= ($model['status']['value']==0 OR $model['status']['value']==40)?'':'disabled'?> required>
										   <small>如营业执照类型为公司，必须填写公司公户账号。如为个体工商户，只需填写负责人私户账号</small>
                                </div>
                            </div>
							<?PHP if($model['status']['value']==40):?>
							<div class="am-form-group">
                                <label class="am-u-sm-3 am-form-label"> 驳回原因 </label>
                                <div class="am-u-sm-9">
                                    <input type="text" class="tpl-form-input" value="<?= $model['reject'] ?>" disabled>
                                </div>
                            </div>
							<?PHP endif;?>
                            <div class="am-form-group">
                                <div class="am-u-sm-9 am-u-sm-push-3 am-margin-top-lg">
									<?php if($model['status']['value']==0 OR $model['status']['value']==40):?>
                                    <button type="submit" class="j-submit am-btn am-btn-secondary"> 
									<?= $model['status']['value']==0?'提交':'修改'?>
                                    </button>
									<?php endif;?>
                                </div>
                            </div>
                        </fieldset>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<!-- 图片文件列表模板 -->
{{include file="layouts/_template/tpl_file_item" /}}

<!-- 文件库弹窗 -->
{{include file="layouts/_template/file_library" /}}

<script>
    $(function () {
		
		// 选择图片
        $('.upload-file-license_copy').selectImages({
            name: 'wxpay[license_copy]'
        });
		// 选择图片
        $('.upload-file-id_card_copy').selectImages({
            name: 'wxpay[id_card_copy]'
        });
		// 选择图片
        $('.upload-file-id_card_national').selectImages({
            name: 'wxpay[id_card_national]'
        });
		// 选择图片
        $('.upload-file-qualifications').selectImages({
            name: 'wxpay[qualifications]'
        });

        $('#my-form').formPost();

    });
</script>
